package priv.stones.controller.administrate.shiro;

import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Component;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/10/17 13:51
 */
@Component
public class ShiroTag {

    /**
     * 是否拥有权限
     *
     * @param permission
     * @return
     */
    public boolean hasPermission(String permission) {
        Subject subject = ShiroUtils.getSubject();
        return subject != null && subject.isPermitted(permission);
    }

}
